﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApp1
{
    class Account
    {
        public int balance;

        public Account()
        {
            balance = 1000;
        }
        public Account(int Balance)
        {
            this.balance = Balance;
        }
        public  void cun()
        {
            Console.WriteLine("存多少：");
            int c = Convert.ToInt32(Console.ReadLine());
            balance += c;
            Console.WriteLine("余额：{0}", balance);
        }
        public  void qu()
        {
            Console.WriteLine("取多少：");
            int c = Convert.ToInt32(Console.ReadLine());

            if (c < balance) {
                balance -= c;
                Console.WriteLine("余额：{0}",balance );
            }else {
                Console.WriteLine("余额不足");
            }
        }
        public  void cha()
        {
            qu();
            cun();
            Console.WriteLine("余额{0}", balance ); 
        }

    }
}
